package com.example.test.view;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Spinner;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.example.test.R;

public class SchoolEssayActivity extends AppCompatActivity {
    private ImageButton Back ;
    private Spinner publish_type ;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.school_essay);
        Back = findViewById(R.id.school_essay_back) ;
        publish_type =(Spinner) findViewById(R.id.school_essay_publish_type);
        Back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });

        Intent intent = getIntent();
        int publishType = intent.getIntExtra("publish_type" ,0);
        publish_type.setSelection(publishType);

        // 获取选中项的文本
        String selectedItemText = publish_type.getSelectedItem().toString();
        // 获取选中项的位置索引
        int selectedItemPosition = publish_type.getSelectedItemPosition();

    }
}
